package com.wf.it.common.api;

import com.wf.it.common.api.hystrix.DoctorServiceHystrixImpl;
import com.wf.it.common.entity.Doctor;
import com.wf.it.common.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "hp-doctor",fallback = DoctorServiceHystrixImpl.class)
public interface DoctorService {
    @GetMapping("/doc/findbyempnos")
    public Result<Map<String,Doctor>> findByEmpNos(@RequestParam("empNos") String[] empNos);
    @GetMapping("/doc/findbyempno")
    public Result<Doctor> findByEmpNo(@RequestParam("empNo")String empNo);
    @GetMapping("/doc/findall")
    public Result<List<Doctor>> findAll();
    /*@GetMapping("/doc/findall2")
    public Result2<List<Doctor>> findAll2();*/
    @GetMapping("/doc/findbydept")
    public Result<List<Doctor>> findByDept(@RequestParam("deptName")String deptName);
    @GetMapping("/doc/findbyid")
    public Result<Doctor> findById(@RequestParam("docid")int docid);
    @PostMapping("/doc/add")
    public Result<Doctor> add(@RequestBody Doctor doc);

}
